package com.fuhao.service.impl;

import com.fuhao.model.Mail;
import com.fuhao.model.User;
import com.fuhao.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service("topic")
public class TopicProductServiceImpl implements ProductService {
	@Autowired
	@Qualifier("jmsTopicTemplate")
	private JmsTemplate jmsTopicTemplate;
	
	public void setJmsTemplate(JmsTemplate jmsTemplate) {
		this.jmsTopicTemplate = jmsTemplate;
	}
//	@Transactional
	public void sendMail(Mail mail) {
		jmsTopicTemplate.convertAndSend(mail);
	}

	@Override
	public void sendUser(User user) {

	}

    @Override
    public void saveUser(User user) {

    }
}
